unit uWork_Connector;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, uConnectionPanel;

type
  TfConnectorForm = class(TForm)
    fConnectBtn: TButton;
    ConnectionPanel: TConnectionPanel;

    procedure fConnectBtnClick(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
    fOnConnect:TNotifyEvent;
  public
    { Public declarations }
    property OnConnect:TNotifyEvent read fOnConnect write fOnConnect;

  end;

var
  fConnectorForm: TfConnectorForm;

implementation

{$R *.dfm}

procedure TfConnectorForm.fConnectBtnClick(Sender: TObject);
begin
    ConnectionPanel.AcceptAll;
    Self.Visible:=False;
    if Assigned(fOnConnect) then fOnConnect(Self);
end;

procedure TfConnectorForm.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
    CanClose:=False;
    Self.Visible:=False;
end;

end.
